/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2024-05-09 11:02:48
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2024-05-27 11:13:04
 * @FilePath: \ken147258.topayClient\src\api\other\order.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */


import request from "@/utils/request";
import { AxiosPromise } from "axios";

const URL = {
  list: '/platformApi/access/list', // 获取通道列表
  edit: '/platformApi/access/status/edit', // 通道状态修改
  delete: '/platformApi/access/delete', // 通道删除
  order_list: '/platformApi/access/order/list', // 获取通道订单列表
  success: '/platformApi/access/order/success', // 完成订单(确认收款)
};

// 获取通道列表
export function list(data: object): AxiosPromise<any> {
  return request({
    url: URL.list,
    method: "get",
    params: data,
  });
}
// 获取通道订单列表
export function order_list(data: object): AxiosPromise<any> {
  return request({
    url: URL.order_list,
    method: "get",
    params: data,
  });
}

// 通道状态修改
export function edit(data: object): AxiosPromise<any> {
  return request({
    url: URL.edit,
    method: "post",
    data: data,
  });
}

export function success(data: object): AxiosPromise<any> {
  return request({
    url: URL.success,
    method: "post",
    data: data,
  });
}

// 通道删除
export function deleteById(data: object): AxiosPromise<any> {
  return request({
    url: URL.delete,
    method: "get",
    params: data,
  });
}
